package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbAreasMapper;
import com.dongdongshop.mapper.TbCitiesMapper;
import com.dongdongshop.mapper.TbProvincesMapper;
import com.dongdongshop.pojo.TbAreas;
import com.dongdongshop.pojo.TbCities;
import com.dongdongshop.pojo.TbProvinces;
import com.dongdongshop.service.ProvincesService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@DubboService
public class ProvincesServiceImpl implements ProvincesService {

    @Autowired
    private TbProvincesMapper provincesMapper;

    @Autowired
    private TbCitiesMapper citiesMapper;

    @Autowired
    private TbAreasMapper areasMapper;

    @Override
    public List<TbProvinces> getHomeSettinfAddressInfo() {

        return provincesMapper.selectByExample(null);
    }

    @Override
    public List<TbCities> getCity(String provinceId) {

        return citiesMapper.selectByPid(provinceId);
    }

    @Override
    public List<TbAreas> getArea(String cityId) {

        return areasMapper.selectByCid(cityId);
    }
}
